package lesson

import (
	"context"
	"github.com/gogf/gf/v2/util/guid"
	"server/internal/library/xunfei"

	"server/api/lesson/voice"
)

func (c *ControllerVoice) Evaluation(ctx context.Context, req *voice.EvaluationReq) (res *voice.EvaluationRes, err error) {
	res = new(voice.EvaluationRes)
	res.Sn = guid.S()
	go func(sn string) {
		xunfei.VoiceEvaluation.Exec(&xunfei.VoiceEvaluationExecReq{
			//Filepath: `C:\wwwroot\goframe-vue-element-admin\server\tests\iseTest.mp3`,
			Filepath: `https://english-lesson-test.oss-cn-hangzhou.aliyuncs.com/EnglishStudyApp/lessonVoice/2024/10/27/56bp120gv40d56lgc2sexz0100mjh6dx.mp3`,
			Text:     "\uFEFF" + "欢迎使用科大讯飞语音能力，让我们一起用人工智能改变世界",
			Sn:       sn,
		})
	}(res.Sn)
	return
}
